package model

import "time"

/*
 * 将发放的薪资进行了封装
 */

type PayCheck struct {
	// 薪水起始计算时间
	payPeriodStartDate	time.Time
	// 薪水结束计算时间
	payPeriodEndDate	time.Time
	// 应付
	grossPay 			float64
	// 实付
	netPay 				float64
	// 扣除
	deductions 			float64
	fields 				map[string]string
}

func NewPaycheck(payPeriodStart, payPeriodEnd time.Time) *PayCheck {
	return &PayCheck{payPeriodStartDate: payPeriodStart, payPeriodEndDate: payPeriodEnd}
}

func (pc *PayCheck) SetGrossPay(grossPay float64) {
	pc.grossPay = grossPay
}

func (pc *PayCheck) SetNetPay(netPay float64) {
	pc.netPay = netPay
}

func (pc *PayCheck) SetDeductions(deductions float64) {
	pc.deductions = deductions
}

func (pc *PayCheck) SetFiled(key, value string) {
	pc.fields[key] = value
}

func (pc *PayCheck) GetGrossPay() float64 {
	return pc.grossPay
}

func (pc *PayCheck) GetNetPay() float64 {
	return pc.netPay
}

func (pc *PayCheck) GetDeductions() float64 {
	return pc.deductions
}

func (pc *PayCheck) GetFiled(name string) string {
	return pc.fields[name]
}

func (pc *PayCheck) GetPayPeriodStartDate() time.Time {
	return pc.payPeriodStartDate
}

func (pc *PayCheck) GetPayPeriodEndDate() time.Time {
	return pc.payPeriodEndDate
}







